package org.ielts.action;

import static com.yifeng.struts2.ResultParameters.*;
import static com.yifeng.struts2.ResultConstants.*;
import static com.yifeng.struts2.ActionUtils.*;

import org.ielts.domain.base.Student;
import org.ielts.service.TutorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.yifeng.modules.annotations.Operation;
import com.yifeng.utils.PageUtils;
import com.yifeng.web.Pagers;
import com.yifeng.web.Paginations;

public class TutorAction extends BaseAction {
	@Autowired
	TutorService tutorService;

	@Operation(result = FILL, operationText = "列出分配给我的学员")
	public String listMyStudent() {
		String uid = profile.getUserId();
		Pageable pageable = getPageable();
		Page<Student> students = tutorService.listMyStudent(uid, pageable);
		
		put("students", students);
		put(PAGINATIONS, new Paginations(students));
		return FILL;
	}
}
